/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package examplesocket;

import java.io.IOException;
import java.io.PrintStream;
import java.net.Socket;

/**
 *
 * @author 5m
 */
public class ServerWriterStream{
    Socket client;
    PrintStream ps;
    ServerWriterStream(Socket pServer)
    {
        client = pServer;
    }
    
    public void start()
    {
        try {
            ps = new PrintStream(client.getOutputStream());
        } catch (IOException ex) {}
    }
    
    public void send(String message)
    {
        ps.println(message+ (char)4);
    }
    
    Socket getSocket()
    {
        return client;
    }

}
